package com.bxait.toymail.auth.server.feign;

import com.bxait.com.utils.R;
import com.bxait.com.vo.member.UserLoginVo;
import com.bxait.com.vo.member.SocialUser;
import com.bxait.com.vo.member.UserRegisterVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/*
@description: 远程调用用户服务
@ClassName MemberFeignService
@author Chen
@create 2023-04-21 9:14
@Version 1.0
*/
@FeignClient("toymail-member")
public interface MemberFeignService {

    /*
     * @param id
     * @==============History===============<br/>
     * @Description //   根据用户id获取用户信息
     * @Date 2023/5/7 2023/5/7
     * @Author < a href="2277411582@qq.com">chen</ a>
     * @return com.bxait.com.utils.R
     */
    @RequestMapping("/member/member/info/{id}")
    R memberInfo(@PathVariable("id") Long id);

    /*
     * @param vo
     * @==============History===============<br/>
     * @Description //   获取用户信息
     * @Date 2023/4/21 2023/4/21
     * @Author < a href="2277411582@qq.com">chen</ a>
     * @return
     */
    @PostMapping("/member/member/login")
    R login(@RequestBody UserLoginVo vo);

    /*
     * @param socialUser
     * @==============History===============<br/>
     * @Description //   处理社交登录的请求
     * @Date 2023/4/21 2023/4/21
     * @Author < a href="2277411582@qq.com">chen</ a>
     * @return
     */
    @PostMapping("/member/member/oauth2/login")
    R oauthLogin(SocialUser socialUser);

    /*
     * @param registerVo
     * @==============History===============<br/>
     * @Description //   处理用户注册
     * @Date 2023/4/21 2023/4/21
     * @Author < a href="2277411582@qq.com">chen</ a>
     * @return
     */
    @PostMapping("/member/member/register")
    R register(UserRegisterVo registerVo);
}
